;;;modify RIM ELEV. text to match SDSK point value (rnd to 10th).
;;;Requires SDSK point block with correct elevation and
;;;existing RIM ELEV. text string
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://paracadd.com
;;;	All rights reserved.
;;;
;;;
(defun c:mhel ()
  (while
    (not
      (setq mh_pt (nentselp "\nSelect manhole SDSK point. "))
    )
  )
  (while
    (not
      (setq txtstr (entsel "\nSelect \"RIM ELEV.\" text. "))
    )
  )
  (if
    (and txtstr
         mh_pt
         (eq
           (cdr(assoc 0 (entget(car mh_pt))))
           "ATTRIB"
         )
         (eq
           (cdr(assoc 0 (entget(car txtstr))))
           "TEXT"
         )
    )
    (progn
      (setq lprec (getvar"luprec"))
      (setvar "luprec" 2)
      (setq nxtent (entget(entnext(car mh_pt))))
      (while
        (not
          (eq (cdr(assoc 0 nxtent)) "SEQEND")
        )
        (setq nxtent (entget(entnext(cdr(assoc -1 nxtent)))))
      )
      (setq insent (cdr(assoc -2 nxtent))
            mhelev (rtos(/(fix(*(atof(cdr(assoc 1 (entget(entnext insent)))))10))10.0))
      )
      (setq txtent (entget (car txtstr)))
      (setq txtent
        (subst (cons 1 (strcat "RIM ELEV. " mhelev "'"))
               (assoc 1 txtent)
               txtent
        )
      )
      (entmod txtent)
      (setvar "luprec" lprec)
    )
  );if
  (princ)
)